import global, { Json_skill } from "../global";
import Library from "./library";

const {ccclass, property} = cc._decorator;

@ccclass
export default class Item_skill extends cc.Component {

    @property(cc.Sprite)
    Sprite:cc.Sprite = null;    //技能精灵

    json_skill:Json_skill = null;  //技能编号
    
    init(json_skill:Json_skill){
        this.json_skill = json_skill;
        global.loadSf(this.Sprite,`/skill/${json_skill.bh}`);
    }

    click(){
        global.library.show(this.json_skill);
    }
}
